package cn.edu.scau.cmi.liyetian.client;

import java.util.Scanner;

import cn.edu.scau.cmi.liyetian.abstractFactory.domainAbstractClass.*;
import cn.edu.scau.cmi.liyetian.abstractFactory.factory.*;

public class AbstractFactoryClient {
	public static void main(String[] args) {
		System.out.println("请选择品牌");
		Scanner scanner = new Scanner(System.in);  
		String brand = scanner.next();  
		AbstractFactory factory = null;
		if(brand.equals("Wens")) {
			factory = new WensFactory();
		}
		else if(brand.equals("Aonong")) {
			factory = new AonongFactory();
		}
		else if(brand.equals("Tianbang")) {
			factory = new TianbangFactory();
		}
		else {
			System.out.println("输入无效");
		}
		
		System.out.println("请选择肉类");
		Scanner scanner2 = new Scanner(System.in);  
		String meatType = scanner.next();  
		ConsumerMeat meat = null;
		if(meatType.equals("beef")||meatType.equals("pork")||meatType.equals("chicken")) {
			meat = factory.getMeat(meatType);
		}
		else {
			System.out.println("输入无效");
		}
		
		if(meat!=null) {
			meat.buy();
		}
	}
}
